<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <pre>
          组件依赖于new vue
          组件内部的data必须是一个函数且必须return一个对象
          template不能直接放元素
        
      </pre
    >
    <div class="box">
      <self></self>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
      Vue.component('self', {
        data: function () {
          return {
            value: '内容',
          }
        },
        template: `
        <div>
            <div>
                {{value}}
            </div>
        </div>
        `,
      })
      new Vue({
        el: '.box',
        data: {},
        methods: {},
      })
    </script>
  </body>
</html>
